<template>
	<view class="all">
		<view class="foreground">
			<text
				style="margin: auto 0px; text-align: center;
            display: block;text-align: center;  font-size: 24px; font-weight: bold;">{{announcemen.announcementTitle}}</text>
			</br><text class="text">{{announcemen.announcementContent}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				searchValue: "",
				announcemen: [],
			}
		},
		methods: {
			search() {
				uni.request({
					url: this.api.Getannoun + "searchAnnouncement",
					method: 'GET',
					data: {
						searchText: this.searchValue
					},
					success: res => {
						if (res.data) {
							this.announcemen = res.data
							console.log(this.announcemen)
						}
					},
					fail: () => {
						
					}
				});
			},
		},
		// onLoad(e) {
			// if (e.announcementTitle) {
				// this.searchValue = e.announcementTitle
				// console.log(this.searchValue)
			// }
			// this.search()
		// }
		//使用onload函数接收参数
		// onLoad: function(option) {
		//   // #ifdef APP-NVUE
		//   const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
		//   // #endif
		//   // #ifndef APP-NVUE
		//   const eventChannel = this.getOpenerEventChannel();
		//   // #endif
		//   eventChannel.emit('acceptDataFromOpenedPage', {data:this.announcemen});
		//   eventChannel.emit('someEvent', {data:this.announcemen});
		//   // 监听acceptDataFromOpenerPage事件，获取上一页面通过eventChannel传送到当前页面的数据
		//   eventChannel.on('acceptDataFromOpenerPage', function(data) {
		//     console.log(this.announcemens)
		//   })
		// }
		onLoad: function (option) {
			this.announcemen = JSON.parse(decodeURIComponent(option.data));
		}
	}
</script>

<style>
	.foreground {
		align-content: center;
	}

	image {
		display: block;
		/* margin: 50%; */
		/* width: 200px; */
		/* height: 200px; */

		width: 100%;

		border-radius: 50%;
		/* padding-left: 50%; */
		/* align-content: center; */
		margin: 0 auto;
		float: left;

	}

	.text {

		font-size: 18px;
		/* float: right; */

		display: flex;
	}
</style>
